1. Field of the Invention
The present invention relates to an image processing unit for determining parameters of white balance adjustment to be applied to an image of a subject, an electronic camera having the function of determining the parameters thereof, and an image processing program for determining the parameters thereof.
2. Description of the Related Art
A general electronic camera has an automatic white balance adjustment function, which expresses a white object in white color irrespective of lighting color.
The following methods (1), (2), and the like are typical methods of the white balance adjustment.
In the method (1), lighting color is judged on the basis of the average color of the whole image of a subject. Using a parameter (white balance gain (gr, gb)) in accordance with the lighting color, the white balance adjustment (multiplication of a signal with the white balance gain (gr, gb)) is carried out.
In the method (2), an achromatic color area is searched through an image of a subject, and lighting color is judged on the basis of the color of the achromatic color area. The white balance adjustment is carried out with white balance gain (gr, gb) in accordance with the judged lighting color (refer to Japanese Unexamined Patent Application Publication Nos. 8-322061, 11-205812, and the like).
The method (1), however, is based on a gray principle (a precondition that the average of object color in the whole image is achromatic color). Thus, when the method (1) is applied to an image which has a bias in the object color (for example, an image of the sea, an image of a lawn, an image of a red wall and the like), the bias of the object color is regarded as the bias of the lighting color, resulting in wrong judgment which may cause failure in the white balance adjustment.
The method (2), on the other hand, is based on a precondition that the lighting color is any of predetermined plural kinds of color (for example, the color of natural light, the color of fluorescent light, and the color of a filament lamp). Thus, when the method (2) is applied to an image of a subject which is illuminated with unexpected lighting color, a chromatic color area is regarded as the achromatic color area under specific lighting color, resulting in wrong judgment which may cause failure in the white balance adjustment.
To reduce the failure described above, a method (3) is proposed.
In the method (3), two judgment results (two lighting colors) by the methods (1) and (2) are averaged with weight based on shooting conditions during taking an image, and the distribution of color in the image. White balance gain (gr, gb) is determined in accordance with the averaged lighting color.
As in the method (3), however, when a plurality of judgment results which are different from each other are averaged, the probability of failure (big failure) in the white balance adjustment is reduced, but the probability of success (big success) in the white balance adjustment is also reduced.